package testCasalib 
{
	import org.casalib.display.CasaMovieClip;
	import org.casalib.events.InactivityEvent;
	import org.casalib.time.Inactivity;
	import org.casalib.util.StageReference;
	/**
	 * ...
	 * @author ...
	 */
	public class __inactivity__ extends CasaMovieClip
	{
		protected var _inactivity:Inactivity;
        
        
        public function __inactivity__() {
            super();
            
            StageReference.setStage(this.stage);
            
            this._inactivity = new Inactivity(3000);
            this._inactivity.addEventListener(InactivityEvent.INACTIVE, this.onUserInactive);
            this._inactivity.addEventListener(InactivityEvent.ACTIVATED, this.onUserActivated);
            this._inactivity.start();
        }
        
        public function onUserInactive(e:InactivityEvent):void {
            trace("User inactive for " + e.milliseconds + " milliseconds.");
        }
        
        public function onUserActivated(e:InactivityEvent):void {
            trace("User active after being inactive for " + e.milliseconds + " milliseconds.");
        }
	}

}